package com.thinkgem.jeesite.modules.gen.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.kpoint.core.base.KpointBaseEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.List;

;

/**
 * 模板配置Entity
 *
 * @author kongxiangsheng
 * @version 2018-11-05
 */
@Data
public class GenTemplate extends KpointBaseEntity {
    public static final String COL_NAME = "`name`";
    public static final String COL_DESC = "`desc`";

    private static final long serialVersionUID = 1L;
    /**
     * 名称
     */
    @TableField(value = "`name`",condition = SqlCondition.LIKE)
    @Length(min = 1, max = 50, message = "名称长度必须介于 1 和 50 之间")
    private String name;
    /**
     * 描述
     */
    @TableField(value = "`desc`",condition = SqlCondition.LIKE)
    @Length(min = 0, max = 50, message = "描述长度必须介于 0 和 50 之间")
    private String desc;
    /**
     * 子表列表
     */
    @TableField(exist = false)
    private List<GenTemplateRel> genTemplateRelList = Lists.newArrayList();
    /**
     * 模板条目
     */
    @TableField(exist = false)
    private List<GenTemplateItem> genTemplateItemList = Lists.newArrayList();
}